import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/home/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        { path: '', name: 'homeData', component: () => import('../views/home/HomeDataView.vue') },
        {
          path: 'base64ToPic',
          name: 'base64ToPic',
          component: () => import('../views/picops/Base64ToPicView.vue')
        },
        {
          path: 'json2FormData',
          name: 'json2FormData',
          component: () => import('../views/dataops/Json2FormDataView.vue')
        },
        {
          path: 'timestampTransform',
          name: 'timestampTransform',
          component: () => import('../views/other/TimestampTransformView.vue')
        },
        {
          path: 'unicode2CN',
          name: 'unicode2CN',
          component: () => import('../views/other/Unicode2CNView.vue')
        },
        {
          path: 'fileUploadDown',
          name: 'fileUploadDown',
          component: () => import('../views/other/FileUploadDownView.vue')
        },
        {
          path: 'jsonOps',
          name: 'jsonOps',
          component: () => import('../views/dataops/JsonOpsView.vue')
        },
        {
          path: 'shareClipboard',
          name: 'shareClipboard',
          component: () => import('../views/dataops/ShareClipboardView.vue')
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/tucao',
      name: 'tucao',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/tucao/TuCaoView.vue')
    },
    {
      path: '/demo',
      name: 'demo',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/DemoView.vue')
    }
  ]
})

export default router
